{extend name="layout/layout"}
{block name="content"}
<main class="user_page  ">
    <section class="">
        <div class="layui-main">
            <div class="user_con">
                <div class="user_headpage" data-load="active_header">
                    {include file="user_activity/header" menu='list' /}
                </div>
                <div class="layui-main">
                    <div class="block_com">
                       <div class="active_w active6  ard_b1">
                          <from class="layui-form">
                             <!-- <div class="layui-upload-drag mb80" id="ID-upload-demo-drag">
                                <div class="b1">
                                   <i class="layui-icon layui-icon-upload"></i>
                                   <div>就缺一張好看的活動照請上傳 1080 X 540 pixel 且小於4MB</div>
                                </div>
                                <div class="layui-hide img_box" id="ID-upload-demo-preview">
                                   <img src="" alt="上传成功后渲染">
                                </div>
                             </div> -->
                             <div class="layui-form-item">
                                <div class="label must">基本資訊</div>
                                <div class="mb20">
                                   <input type="text" name="name" lay-verify="required" value="{$organizer.name|default=''}" placeholder="主办单位名称" autocomplete="off"
                                      class="layui-input">
                                </div>
                                <input type="hidden" name="id" value="{$organizer.id|default=0}">
                                <div class="">
                                   <textarea type="text" name="introduction" lay-verify="required" value="{$organizer.introduction|default=''}" placeholder="主办单位简介" autocomplete="off"
                                      class="layui-textarea">{$organizer.introduction|default=''}</textarea>
                                </div>
                             </div>
                             <div class="layui-form-item">
                                <div class="label must">聯絡資料
                                </div>
                                <div class="d-flex mb20">
                                   <input type="text" name="phone" lay-verify="required"  value="{$organizer.phone|default=''}"  placeholder="电话号码" autocomplete="off"
                                      class="layui-input mr20">
                                   <input type="text" name="extention_phone"  value="{$organizer.extention_phone|default=''}" lay-verify="" placeholder="分机号码（选填）" autocomplete="off"
                                      class="layui-input">
                                </div>
                                <div>
                                   <input type="text" name="email"  value="{$organizer.email|default=''}"  lay-verify="required|email" placeholder="Email" autocomplete="off"
                                      class="layui-input">
                                </div>
                             </div>
                             <div class="layui-form-item">
                                <div class="label ">語系/幣別
                                </div>
                                <div class="d-flex">
                                   <div class="mr20 flex-1">
                                      <select name="lang" lay-filter="aihao">
                                         <option  {if !empty($organizer.lang) && $organizer.lang == '繁体中文' } 'selected' {/if}   value="繁体中文">繁体中文</option>
                                         <option {if !empty($organizer.lang) && $organizer.lang == '简体中文' } 'selected' {/if}   value="简体中文">简体中文</option>
                                         <option {if !empty($organizer.lang) && $organizer.lang == '英语' } 'selected' {/if}   value="英语">英语</option>
                                      </select>
                                   </div>
                                   <div class=" flex-1">
                                      <select name="currency" lay-filter="aihao">
                                         <option {if !empty($organizer.currency) && $organizer.currency == '台币' } 'selected' {/if}  value="台币">台币</option>
                                         <option {if !empty($organizer.currency) && $organizer.currency == '人民币' } 'selected' {/if}  value="人民币">人民币</option>
                                         <option {if !empty($organizer.currency) && $organizer.currency == '人民币' } 'selected' {/if} value="美元">人民币</option>
                                      </select>
                                   </div>
        
                                </div>
                             </div>
                             <div class="mt40 d-flex jc-s al-c">
                                <button class="layui-btn layui-btn-lg w100 layui-bg-orange next-btn" lay-submit lay-filter="formDemo">建立</button>
                             </div>
                          </from>
                       </div>
                    </div>
                 </div>
               
            </div>
        </div>
    </section>
</main>
<script>
    layui.use(function () {
      var upload  = layui.upload;
      var layer   = layui.layer;
      var element = layui.element;
      var $       = layui.$;
      var laydate = layui.laydate;
      var form    = layui.form
        //提交
        form.on('submit(formDemo)', function(data){
            $.quickPost('/activity/user/organizer', data.field).done(function(){
                // layer.msg('操作成功')
            })
            return false;
        });
      upload.render({
         elem: '#ID-upload-demo-drag',
         url: '', // 实际使用时改成您自己的上传接口即可。
         done: function (res) {
            layer.msg('上传成功');
            $('#ID-upload-demo-drag .b1').addClass('layui-hide')
            $('#ID-upload-demo-preview').removeClass('layui-hide')
               .find('img').attr('src', res.files.file);
            console.log(res)
         }
      });
   })
</script>
{/block}